import java.util.LinkedList;
import java.util.Scanner;
import java.util.Stack;

import static java.lang.Math.pow;

public class Day4 {
    public static void main(String[] args) {
        //
        System.out.println(StrToInt("-p2147483647"));
    }

    public static int StrToInt(String str) {
        if(str==null){
            return 0;
        }
        char flag=str.charAt(0);

//         if(str.charAt(0)=='+'||str.charAt(0)=='-'){
//              flag=str.charAt(0);
//             //str=str.substring(1,str.length());
//         }
        Stack<Integer> stack=new Stack<>();
        for(int i=0;i<str.length();i++){
            char ch=str.charAt(i);
            if((ch!='+'&&ch!='-')&&(ch<'0'||ch>'9')){
                return 0;
            }
            if(ch!='-'&&ch!='+'){
                stack.push(ch-'0');
            }

        }

        int target=0;
        int Bex=10;
        int maxStackSize=stack.size();
        for(int i=0;i<maxStackSize;i++){
            target+=pow(10,i)*stack.pop();
        }
        if(flag=='-'){
            target=-target;
        }
        return target;
    }

    public static void main4(String[]args){
        Scanner scan=new Scanner(System.in);
        String s1=scan.nextLine();
        Stack<String> stack=new Stack<>();
        StringBuffer elemt=new StringBuffer();
        for(int i=0;i<s1.length();i++){
            char ch=s1.charAt(i);
            if(ch!=' '){
                elemt.append(ch);


            }else{
                stack.push(elemt.toString());
                elemt=new StringBuffer();
            }
        }
        stack.push(elemt.toString());
        System.out.println(stack.size());
        String target="";
        int maxCount=stack.size();
        for(int i=0;i<stack.size();i++){
            if(i==maxCount-1){
                target+=stack.pop();
                break;
            }
            target+=stack.pop()+" ";
        }
        System.out.println(target);

}

    public static void main3(String[]args){
        Scanner scan=new Scanner(System.in);
        String s1=scan.nextLine();
        Stack<String> stack=new Stack<>();
        StringBuffer elemt=new StringBuffer();
        for(int i=0;i<s1.length();i++){
            char ch=s1.charAt(i);
            if(ch!=' '){
                elemt.append(ch);
                stack.push(elemt.toString());
                elemt=new StringBuffer();
            }
        }
        stack.push(elemt.toString());
        String target="";
        for(int i=0;i<stack.size();i++){
            if(i==stack.size()-2){
                target+=stack.pop();
                break;
            }
            target+=stack.pop()+" ";
        }
        System.out.println(target);
    }
    public static void main2(String[]args){
        Scanner scan=new Scanner(System.in);
        int n=scan.nextInt();
        long[]array=new long[n];
        for(int i=0;i<n;i++){
            array[i]=scan.nextInt();
        }
        int sum=0;
        if(n==1){
            sum++;
        }
        for(int i=0,j=1;j<array.length;){
            if(array[i]>=array[j]){
                sum++;
                while(array[j-1]>=array[j]){
                    j++;
                    if(j>=array.length){
                        break;
                    }
                }
                i=j;
//                if(j== array.length-1&&array[j]>array[j-1]){
//                    sum++;
//                }
                j++;

                continue;
            }
            if(array[i]<=array[j]){
                sum++;
                while(array[j-1]<=array[j]){
                    j++;
                    if(j>=array.length){
                        break;
                    }
                }
                i=j;
//                if(j== array.length-1&&array[j]<array[j-1]){
//                    sum++;
//                }
                j++;
            }
        }

        System.out.println(sum);

//        15
//        1 2 1 3 4 2 1 4 2 3 2 1 8 2 3   15
//1 2 1 2 1 2 1 2 1 2 2 1 1 1 2
    }

    public static void main1(String[] args) {
       CPU cpu=new CPU();
       cpu.setSpeed(10);
       HardDisk hardDisk=new HardDisk();
       hardDisk.setAmount(1024);
       PC pc=new PC();
       pc.setAll(cpu,hardDisk);
        System.out.println(pc);;
    }
}

class CPU{
    private int speed;

    public int getSpeed() {
        return speed;
    }

    public void setSpeed(int speed) {
        this.speed = speed;
    }
}

class HardDisk{
    private int amount;

    public int getAmount() {
        return amount;
    }

    public void setAmount(int amount) {
        this.amount = amount;
    }
}

class PC{
    private CPU cpu;
    private HardDisk hardDisk;
    public  void setAll(CPU cpu,HardDisk hardDisk){
        this.cpu=cpu;
        this.hardDisk=hardDisk;
    }

    @Override
    public String toString() {
        return "PC电脑{" +
                "cpu=" + cpu.getSpeed() +
                ", hardDisk=" + hardDisk.getAmount() +
                '}';
    }
}









class Person{
    private String name;
    private int age;
    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public  void display(){
        System.out.println("姓名："+name+"年龄："+age);
    }
}